from sqlalchemy import Text, Date, DateTime, Column, String
from config.database import Base


class StockInfo(Base):
    """
    股票基础信息表
    """

    __tablename__ = 'stock_info'
    __table_args__ = {'comment': '股票基础信息表'}

    stock_code = Column(String(20), primary_key=True, nullable=False, comment='股票代码')
    stock_name = Column(String(100), nullable=False, comment='股票名称')
    exchange_id = Column(String(10), nullable=True, comment='交易所代码')
    ipo_date = Column(Date, nullable=True, comment='上市日')
    expire_date = Column(Date, nullable=True, comment='退市日')
    instrument_status = Column(String(20), nullable=True, comment='证券状态')
    interface_data = Column(Text, nullable=True, comment='接口获取到的该股票数据报文')
    interface_data_md5 = Column(String(32), nullable=True, comment='接口数据报文MD5')
    update_time = Column(DateTime, nullable=True, comment='更新时间')
    create_time = Column(DateTime, nullable=True, comment='创建时间')



